/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package swing;

import javax.swing.JOptionPane;

/**
 *
 * @author Iskandar Sarkawi
 */
public class Example1_JOptionPane {

    public static void main(String[] args) {
        String fn = JOptionPane.showInputDialog("Enter first number");
        String sn = JOptionPane.showInputDialog("Enter second number");

        int num1 = Integer.parseInt(fn);
        int num2 = Integer.parseInt(sn);
        int sum = num1 + num2;

        JOptionPane.showMessageDialog(null, "The answer is " + sum, "the title", JOptionPane.PLAIN_MESSAGE);

    }

}
